#include <iostream>
#include <string>
#include <vector>

using namespace std;
string s1;
vector<string> ret;
int k;
int main()
{
    ret.resize(255);
    cin >> s1;
    auto it = s1.begin();
    while (it != s1.end())
    {
        if ((*it) >= '0' && (*it) <= '9')
        {
            ret[k] += (*it);
        }
        else {
            k++;
        }
        it++;
    }
    int max = 0;
    int flag = 0;
    for (int i = 0; i < ret.size(); i++)
    {
        if (ret[i].size() > max)
        {
            max = ret[i].size();
            flag = i;
        }
    }
    cout << ret[flag];
    return 0;

}